#include "libedgeimpl.h"
#include "flog.h"
//#define LOG(value) interface_->onLog(__FILE__ + std::string(":") +std::to_string(__LINE__)+ std::string(":") + initInfo_.appname +":"+value)

#ifdef LOG
#undef LOG
#endif
#define LOG(level) _LOG(std::bind(&EdgeImpl::onLog,this,std::placeholders::_1),level)

EdgeImpl::EdgeImpl(){
    
}

EdgeImpl::~EdgeImpl()
{

}

void EdgeImpl::uploadRealData(const std::string& value){
    //LOG(value);
    LOG(INFO)<<value;
    LOG(INFO)<<value;
}

void EdgeImpl::uploadEventData(const std::string& value){
    LOG(INFO)<<value;
}

void EdgeImpl::onRecieve(const std::string& param){
    if(interface_)
        interface_->onRecieve(param);
}

void EdgeImpl::onLog(const std::string& param){
    if(interface_)
        interface_->onLog("[" + initInfo_.appname +"] "+param);
}